# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=mutter-wayland
pkgver=3.12.1
pkgrel=1
pkgdesc="A Wayland compositor for GNOME"
arch=(x86_64)
license=(GPL)
depends=(mutter)
makedepends=(intltool gnome-doc-utils)
url="http://www.gnome.org"
options=('!emptydirs')
install=mutter-wayland.install
source=(https://download.gnome.org/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz)
sha256sums=('2c04d8feb5611480ae6679f6b0f0ad76f52e6f4181469e0b01a66feb2bcec8d9')


prepare() {
  cd "$pkgname-$pkgver"
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr --sysconfdir=/etc \
      --libexecdir=/usr/lib/$pkgname \
      --localstatedir=/var --disable-static \
      --disable-schemas-compile --enable-compile-warnings=minimum

  #https://bugzilla.gnome.org/show_bug.cgi?id=655517
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install

  # Already in "mutter"
  rm -r "$pkgdir"/usr/share/{man,gtk-doc,GConf,gnome-control-center}
  rm "$pkgdir/usr/share/glib-2.0/schemas/org.gnome.mutter.gschema.xml"
}
